package com.dynamo.transport.network.practise.channel;

import java.net.InetSocketAddress;
import java.net.SocketAddress;

/**
 * @author duanyimiao
 * @create 2018-12-17 10:13 AM
 * @description 抽象的传输媒介
 **/
public interface Channel {
    //新建状态
    int OPEND = 0;
    //服务端绑定进行监听
    int BIND = 1;
    //客户端取连接
    int CONNECT = 2;

    //已经连接
    int CONNECTED = 3;

    ChannelConfig getConfig();

    ChannelPipeline getPipeline();

    ChannelFuture write(Object msg);

    ChannelFuture bind(SocketAddress socketAddress);

}
